window.onload = function() {
	document.getElementById("register").onclick = function () {
		var str_stuno = document.getElementById("stuno").value;
		var str_idno = document.getElementById("idno").value;
		var str_pass = document.getElementById("pass").value;
		var str_con_pass = document.getElementById("con_pass").value;
		var b_stu = ver_stuno(str_stuno);
		var b_id = ver_id(str_idno);
		var b_pass = ver_pass(str_pass);
		var b_con_pass = ver_pass(str_con_pass);
		var b_two_pass = ver_two_pass(str_pass, str_con_pass);

		if(!b_stu) {
			document.getElementById("warn_stuno").style.display = "inline-block";
		}
		if(!b_id) {
			document.getElementById("warn_idno").style.display = "inline-block";
		}
		if(!b_pass) {
			document.getElementById("warn_pass").style.display = "inline-block";
		}
		if(!b_two_pass) {
			document.getElementById("warn_con_pass").style.display = "inline-block";
		}
		if(b_stu && b_id && b_pass && b_two_pass) {
			document.forms[0].submit();
		}
	}

	var stuno = document.getElementById("stuno");
	if(stuno.addEventListener) {
		stuno.addEventListener("blur", function() {
				var b_stu = ver_stuno(this.value);
				if(b_stu) {
				document.getElementById("warn_stuno").style.display = "none";
				} else {
				document.getElementById("warn_stuno").style.display = "inline-block";
				}
				}, false);
	} else if(stuno.attachEvent) {
	}
	var idno = document.getElementById("idno");
	if(idno.addEventListener) {
		idno.addEventListener("blur", function() {
				var b_id = ver_id(this.value);
				if(b_id) {
				document.getElementById("warn_idno").style.display = "none";
				} else {
				document.getElementById("warn_idno").style.display = "inline-block";
				}
				}, false);
	} else if(idno.attachEvent) {
	}
	var pass = document.getElementById("pass");
	if(pass.addEventListener) {
		pass.addEventListener("blur", function() {
				var b_pass = ver_pass(this.value);
				var b_two_pass = ver_two_pass(this.value, document.getElementById("con_pass").value);
				if(b_pass) {
				document.getElementById("warn_pass").style.display = "none";
				if(b_two_pass) {
				document.getElementById("warn_con_pass").style.display = "none";
				} else {
				document.getElementById("warn_con_pass").style.display = "inline-block";
				}
				} else {
				document.getElementById("warn_pass").style.display = "inline-block";
				document.getElementById("warn_con_pass").style.display = "none";
				}
				}, false);
	} else if(pass.attachEvent) {
	}
	var con_pass = document.getElementById("con_pass");
	if(con_pass.addEventListener) {
		con_pass.addEventListener("blur", function() {
				var pass = document.getElementById("pass").value;
				var b_pass = ver_pass(pass);
				var b_two_pass = ver_two_pass(pass, this.value);
				if(!b_pass) {
				document.getElementById("warn_pass").style.display = "inline-block";
				document.getElementById("warn_con_pass").style.display = "none";
				} else {
				if(b_two_pass) {
				document.getElementById("warn_con_pass").style.display = "none";
				} else {
				document.getElementById("warn_con_pass").style.display = "inline-block";
				}
				}
				}, false);
	} else if(con_pass.attachEvent) {
	}
}
